﻿using System.Collections.Generic;
using System.Text;

namespace SimpleOrmCFPC.Core.Query.Where
{
    public class LikeWhereElement : IWhereElement
    {
        private IWhereElement left;
        private IWhereElement right;

        public LikeWhereElement(IWhereElement left, IWhereElement right)
        {
            this.left = left;
            this.right = right;
        }

        public void Visit(WhereToSqlBuilder visitor, StringBuilder builder, List<object> parameters)
        {
            builder.Append("(");
            left.Visit(visitor, builder, parameters);
            builder.Append(" like ");
            right.Visit(visitor, builder, parameters);
            builder.Append(")");
        }
    }
}